using System;
using System.Drawing;
using System.Windows.Forms;
class PaintTwoForms
{
	static Form form1,form2;
	public static void Main()
	{
		form1=new Form();
		form2=new Form();

		form1.Text="Form1";
		form1.BackColor=Color.Chocolate;
		form1.Paint+=new PaintEventHandler(MyPaintHandler);
		
		form2.Text="Form2";
		form2.BackColor=Color.White;//Chocolate;
		form2.Paint+=new PaintEventHandler(MyPaintHandler);

		form2.Show();

		Application.Run(form1);

	}
	static void MyPaintHandler(object objSender,PaintEventArgs pea)
	{
		Form form=(Form)objSender;
		Graphics grfx=pea.Graphics;
		string str;

		if(form==form1)
			str="Hello form form1";
		else 
			str="hello from form2";
		grfx.DrawString(str,form.Font,Brushes.Aquamarine,0,0);
	}
}